Some computer applications are so large and the number of users of the applications so large that it makes sense to divide up the work of the application among multiple computers and, potentially, to store the information used by the application in many different places. Such applications are commonly referred to as distributed applications. Conventional distributed applications store shared information in multiple databases that may reside on many different computers.
Recently, however, software developers have begun to create distributed object systems. Distributed object systems comprise shared objects that may be accessed by one or more processes running on one or more computers. In distributed object systems, then, an additional shared resource, the distributed object, needs to be accounted for.
In a distributed object environment, objects are accessed in the context of transactions. When an object is about to be accessed in the context of a particular transaction but is already in use by another transaction, then the second transaction will often be required to wait until the first transaction has completed in order to ensure that each transaction accomplishes a logically consistent update. Variations in such a locking mechanism may allow read-only transactions to proceed, or may control locking at the level of individual object instance variables or at the level of groups of objects. In any case, when a transaction seeks to access such a locked resource, that transaction may have to wait to use that resource.
Because transactions are operating on multiple objects asynchronously, it is possible that a transaction that is about to go into a wait state may be doing so to wait for a second transaction that is already waiting on the first transaction for access to another resource. This is commonly called a deadlock as each transaction may wait for the other indefinitely.
Although some deadlock detection methods exist, these mechanisms often detect deadlock after the deadlock condition has already occurred, rather than detecting it just prior to its occurrence.